/*
	@file: log/include/Log.h
	@author: Wolfhead
 */

#ifndef _LOG_LOG_H_
#define _LOG_LOG_H_

#include "LogContext.h"
#include "LogPriority.h"
#include "LogDispatcher.h"
#include "LogStream.h"

// loggers
#include "logger/Logger.h"	
#include "logger/OStreamLogger.h"

// formatter
#include "formatter/Formatter.h"
#include "formatter/StringFormatter.h"

#include <boost/current_function.hpp>


namespace logger
{

LogDispatcher & get_log_dispatcher();

void logf(LogPriority priority, 
		  const LogContext& context,
	      const char * format, ...);

void logf(const std::string& name, 
		  const LogContext& context,
	      const char * format, ...);

typedef LogStream logs;

};

#define CLOGF(priority, format, ...) \
	logger::logf(priority, logger::LogContext(__FILE__, BOOST_CURRENT_FUNCTION, __LINE__), format, ##__VA_ARGS__)

#define CLOGS(priority) \
	logger::logs(priority, logger::LogContext(__FILE__, BOOST_CURRENT_FUNCTION, __LINE__)).Stream()

#endif
